home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / serial / callback.001 / callback~ / callback / mgetty / cbmgetty.c < prev    next >
C/C++ Source or Header  |  1996-07-23  |  920b  |  29 lines

  1.  
  2. #include "cbmgetty.h"
  3.  
  4. /*
  5.     the tty-line must be argv[1]
  6. */    
  7.  
  8. void main (int argc, char **argv)
  9. {
  10.     startup(argc, argv);    /* initial startup: 
  11.                                 read the setupfile, determine the name of 
  12.                                 the tty-line(s) that can be used
  13.                             */
  14.                             
  15.     log(log_default, "'%s %s' started", getprogname(), argv[1]);
  16.  
  17.     make_filenames(argv[1]);    /* names for file-manipulation, argv[1] */
  18.                                 /* must be the ttyS-line to use         */
  19.  
  20.     update_cbstate(argv[1]);    /* upate to waiting or next callback state */
  21.     
  22.     argv[0] = modemfile();      /* argv[0] = mgetty.ttySx */
  23.  
  24.     log(log_on, "Executing %s from cbmgetty", argv[0]);
  25.     execv(argv[0], argv);       /* original mgetty program via the link */
  26.  
  27.     error("Can't exec %s.", argv[0]);   /* we should never get here */
  28. }
  29.